<?php
//    echo $this->Form->create('reservas')
?>

<h1 class="h1-chanfro"><?php echo __('Solicitações de reservas de resíduos') ?></h1>

<table id="tabela" class="tablesorter table table-striped table-bordered table-hover">
    <thead>
    <th class="header"><?php echo __('Requerente') ?></th>
    <th class="header"><?php echo __('Centro') ?></th>
    <th class="header"><?php echo __('Sala') ?></th>
    <th class="header"><?php echo __('Quantidade solicitada') ?></th>
    <th class="header"><?php echo __('Quantidade disponível') ?></th>
    <th class="header"><?php echo __('Justificativa') ?></th>
    <th class="header"><?php echo __('Ação'); ?></th>
</thead>
<tbody>

    <?php
    if ($reservas != NULL) {
        foreach ($reservas as $reserva) {
            ?>
    <tr>
        <td><?php echo $reserva['reservas']['nome_usuario'] ?></td>
        <td><?php echo $reserva['reservas']['centro'] ?></td>
        <td><?php echo $reserva['reservas']['sala'] ?></td>
        <td><?php echo $reserva['reservas']['quantidade'] ?></td>
        <td><?php echo $reserva['produtos']['quantidade'] ?></td>
        <td><?php echo $reserva['reservas']['obs'] ?></td>
        <td><?php echo $this->Form->postLink(__('Aceitar'), array('controller' => 'Reservas', 'action' => 'aceitar', $reserva['reservas']['id']), array('title' => __('Aceitar reserva'), 'class' => 'btn btn-success btn-primary btn-xs')) ?>
            <?php echo $this->Form->postLink(__('Rejeitar'), array('controller' => 'Reservas', 'action' => 'rejeitar', $reserva['reservas']['id']), array('title' => __('Rejeitar reserva'), 'class' => 'btn btn-danger btn-primary btn-xs')) ?></td>
        </tr><?php }
    } ?>
</tbody>
</table>